<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>重置密码-青鸟优品</title>
    <link rel="stylesheet" href="./assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="./assets/css/common.css">
    <script src="./assets/js/jquery.js"></script>
    <script src="./assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="./assets/layer/layer.js"></script>></script>
    <script src="./assets/js/common.js"></script>
    <script src="./assets/js/ucenter.js"></script>
</head>

<body>

    <nav class="navbar navbar-fixed-top">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="./index.html">青鸟商城</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-left">
                    <!-- <li class="active"><a href="#">热门推荐 <span class="sr-only">(current)</span></a></li>
                    <li><a href="#">国际品牌</a></li>
                    <li><a href="#">数码电器</a></li>
                    <li><a href="#">智能手机</a></li>
                    <li><a href="#">每日特价</a></li> -->
                </ul>

                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="./ucenter.html">
                            <i class="glyphicon glyphicon-user"></i>
                            个人中心
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <i class="glyphicon glyphicon-off"></i>
                            安全退出</a>
                    </li>
                </ul>

            </div>
        </div>
    </nav>



    <div class="container user-info">
        <div class="row">
            <div class="col-xs-2">
                <ul class="nav nav-pills nav-stacked ">
                    <!-- 点击显示模态框 -->
                    <div class="avatar" data-toggle="modal" data-target="#myModal">
                        <img src="./uploads/avatar/01.jpg" class="img-circle user-avatar">
                    </div>
                    <hr>
                    <li role="presentation"><a href="./ucenter.html">会员中心</a></li>
                    <li role="presentation"><a href="./order-list.html">我的订单</a></li>
                    <li role="presentation"><a href="./update-info.html">信息设置</a></li>
                    <li role="presentation" class="active"><a href="./reset-pwd.html">重置密码</a></li>
                    <li role="presentation"><a href="./address.html">收货地址</a></li>
                </ul>
            </div>
            <div class="col-xs-10">
                <!-- <div class="alert alert-danger">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    错误提示
                </div> -->
                <form method="POST" action="#">
                    <div class="form-group">
                        <label for="pwd">新密码</label>
                        <input name="password" required type="password" class="form-control" id="pwd" placeholder="新密码">
                    </div>
                    <div class="form-group">
                        <label for="pwd2">确认密码</label>
                        <input name="password1" required type="password" class="form-control" id="pwd1" placeholder="确认密码">
                    </div>
                    <button type="button" class="btn btn-danger btn-update">确认修改</button>
                </form>
            </div>
        </div>
    </div>

    <div class="container-fluid footer">
        <div class="row">
            <div class="col-lg-12">
                Copyright 2019 by www.braccp.com 北京畅想唯优信息技术有限公司 All rights reserved.
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                联系电话：029-88212666 地址：西安市雁塔区电子一路 石油大学北门工会楼二层
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                备案号：陕ICP备19013769号-1
            </div>
        </div>
    </div>
</body>
<script>
    $(function(){
        // 登录信息验证
        auth();

        $(".btn-update").on('click',function(){
            // console.log(111);
            // 获取表单数据
            var pwd=$("#pwd").val().trim();
            var pwd1=$("#pwd1").val().trim();
            if(pwd===''){
                return layer.msg('请输入新密码');
            }
            if(pwd1===''){
                return layer.msg('请输入确认密码');
            }
            if(pwd!==pwd1){
                return layer.msg('两次密码输入不一致');
            }
            // 发送请求
            $.ajax({
                url:'/apis/index.php?c=user&a=reset_pwd',
                type:'POST',
                data:{password:pwd},
                dataType:'json',
                headers:{
                    Token:localStorage.getItem('token')
                }
            }).then(res=>{
                layer.msg(res.msg);
            });

        });    
    });
</script>
</html>